#ifndef ASSERT_TEST_HPP__
#define ASSERT_TEST_HPP__

#include "value.hpp"
#include "exception.hpp"

namespace BMD
{
  class VM;
  class Value;

 /*************************************
  * runtime assertions
  ************************************/
  class assert_test
  {
  public:
    virtual void validate(VM* vm) = 0;
    virtual ~assert_test() { }
  };

  /**
   * tests if the accumulator is equal to a
   * given value when the program reaches the test
   */
  class acc_equals_test : public assert_test
  {
  public:
    acc_equals_test(Value v) : comp_value(v) { }
    void validate(VM* vm);
  private:
    Value comp_value;
  };
  
  /**
   * throws an error if control reaches the test
   */
  class does_not_reach_test : public assert_test
  {
  public:
    void validate(VM* vm);
  };
}

#endif
